<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>文章列表--layui后台管理模板 2.0</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="../../css/public.css" media="all" />
	</head>

	<body class="childrenBody">
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">订单号</label>
			<div class="layui-input-block">
				<input type="text" name="dingdanhao" class="layui-input dingdanhao" readonly lay-verify="required" placeholder="请输入商品链接获取商品价格">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">商品主图</label>
			<div class="layui-input-block">
				<img src="../../images/wk-tu_1.jpg" alt="商品主图" width="30%" id="renwu_good_img" class="renwu_good_img" />
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">商品价格</label>
			<div class="layui-input-block">
				<input type="text" name="renwu_good_price" class="layui-input renwu_good_price" readonly lay-verify="required" placeholder="请输入商品链接获取商品价格">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<hr class="layui-bg-green" />
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">用户账号</label>
			<div class="layui-input-block">
				<input type="text" name="font_user" class="layui-input font_user" readonly lay-verify="required" placeholder="请输入商品链接获取商品价格">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">旺旺号</label>
			<div class="layui-input-block">
				<input type="text" name="font_wangwang" class="layui-input font_wangwang" readonly lay-verify="required" placeholder="请输入商品链接获取商品价格">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">实付金额</label>
			<div class="layui-input-block">
				<input type="text" name="zhifu_jine" class="layui-input zhifu_jine" readonly lay-verify="required" placeholder="请输入商品链接获取商品价格">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">完成时间</label>
			<div class="layui-input-block">
				<input type="text" name="dingdan_time" class="layui-input dingdan_time" readonly lay-verify="required" placeholder="请输入商品链接获取商品价格">
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">订单截图</label>
			<div class="layui-input-block">
				<img src="../../images/wk-tu_1.jpg" alt="商品主图" width="30%" id="dingdan_img" class="dingdan_img" />
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<hr class="layui-bg-red" />
		</div>
		<form class="layui-form">
			<div class="layui-form-item layui-row layui-col-xs12">
				<label class="layui-form-label">是否通过</label>
				<div class="layui-input-block renwu_check">
					<input type="hidden" name="font_user" class="layui-input font_user" readonly lay-verify="required" placeholder="请输入商品链接获取商品价格">
					<input id="id" type="hidden" name="id" class="id" />
					<input id="user_name" type="hidden" name="user_name" class="user_name" />
					<input type="radio" name="renwu_check" value="1" title="通过" >
					<input type="radio" name="renwu_check" value="0" title="不通过"checked>
				</div>
			</div>
			<div class="layui-form-item layui-row layui-col-xs12">
				<label class="layui-form-label">原因</label>
				<div class="layui-input-block">
					<textarea class="layui-textarea check_reason" name="check_reason" id="check_reason" placeholder="若不通过，请输入原因；否则放空"></textarea>
				</div>
			</div>
			<div class="layui-form-item layui-row layui-col-xs12">
				<div class="layui-input-block">
					<button id="addrenwu" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="addrenwu">提交</button>
				</div>
			</div>
		</form>
		<script type="text/javascript" src="../../layui/layui.js"></script>
		<script src="../../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			layui.use(['form', 'layer', 'laydate', 'table', 'laytpl'], function() {
				var form = layui.form,
					layer = parent.layer === undefined ? layui.layer : top.layer,
					$ = layui.jquery,
					laydate = layui.laydate,
					laytpl = layui.laytpl,
					table = layui.table,
					laypage = layui.laypage;
				//$("#shili").show();
				form.on("submit(addrenwu)", function(data) {
					//弹出loading
					//alert($("#file").val());
					var index = top.layer.msg('数据提交中，请稍候', {
						icon: 16,
						time: false,
						shade: 0.8
					});
					var action = data.form.action; //表单提交URL地址
					$.post("http://127.0.0.1:88/index.php/renwu/renwu/doCheckRenwu", data.field, function(obj) {
						if(obj.code == 200) {
							setTimeout(function() {
								top.layer.close(index);
								top.layer.msg(obj.msg);
								layer.closeAll("iframe");
								//刷新父页面
								parent.location.reload();
							}, 2000);
						} else {
							setTimeout(function() {
								top.layer.msg(obj.msg);
								//刷新父页面
							}, 2000);
						}
					});

					return false;
				})

				$("#get_goodmsg").click(function() {
					if($(".renwu_good_url").val() == "") {
						layer.msg("请输入商品链接！");
					} else {
						$.ajax({
							type: "post",
							url: "http://127.0.0.1:88/index.php/general/taobao/clicb",
							data: "url=" + encodeURIComponent($(".renwu_good_url").val()),
							dataType: "JSON",
							success: function(res) {

								//console.log(wangwang);
								layer.msg("数据获取结束");
								/*var a = res.manager;
								good_wangwang = a.substr(3);
								if(wangwang!=good_wangwang){
									layer.msg("当前店铺联系方式与商品不一致，请重新选择");
								}*/
								setTimeout(function() {
									$(".renwu_good_titles").val(res.titles);
									$(".user_name").val(res.titles);
									$(".renwu_good_price").val(res.price);
									$("#manager").val(res.manager);
									$(".renwu_url").val($(".renwu_good_url").val());
									$(".renwu_img_url").val(res.images);
									$(".renwu_good_img").attr("src", res.images);
								}, 100);
								//return false;

							}
						});
					}
				})
				/*$("#renwu_wangwang").change(function(){
					/*var value	= $("#renwu_wangwang option:selected").val();
					console.log(value);
					if(value!=good_wangwang){
						layer.msg(good_wangwang);
					}*/
				/*	alert("1");
				});*/
				if($(".renwu_wangwang").attr("checked") == true) {
					console.log($(".renwu_wangwang option:selected").text());
				}

			})
		</script>
	</body>

</html>